package org.projectname.service.admin.manager;

import java.util.List;

import org.hishenframework.core.data.jdbc.template.JdbcOperater;
import org.projectname.entity.manager.RoleResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class RoleResourceService extends JdbcOperater<RoleResource>{
	
	public int deleteByResourceId(int resourceId){
		String sql = "DELETE FROM t_system_role_resource WHERE resource_id = ?";
		return getJdbcTemplate().update(sql, resourceId);
	}

	public List<RoleResource> getByResourceId(int resourceId) {
		String sql = "SELECT * FROM t_system_role_resource WHERE resource_id = ?";
		return getHishenJdbcTemplate().queryForListBean(sql, RoleResource.class, resourceId);
	}

	@Override
	public int delete(int id) {
		return 0;
	}

	@Override
	public RoleResource get(Object pk) {
		return null;
	}
}
